Forecasting Lock Contention Before Adopting Another Lock Algorithm
نویسندگان
چکیده
Locks are often used in parallel applications to ensure correct behavior, but frequently induce performance bottlenecks caused by contention at frequently accessed locks. There are state-of-the-art locking algorithms, whose performance under high contention is superior to that of the most commonly used ones. However, some of these have a different interface, and adopting them incurs a reimplementation effort. It is therefore important to efficiently estimate the potential benefit of adopting another lock algorithm, prior to investing effort for reimplementation. We use the Queue Delegation Locking algorithm (QD locking) as an example, which to our knowledge has the best performance among such algorithms. For high-contention scenarios, delegation-based locking algorithms perform well due to their ability to delegate critical sections to a single thread, which requires using a different interface than the traditional lock()/unlock(). In the paper, we present a method that allows predicting the contention under the QD locking algorithm which does not require any reimplementation. In our method, one only needs to gather a set of machine-specific parameters and profile the target application in a single-threaded run to obtain the lock access patterns and holding times. Given these inputs, our method uses queueing networks to predict the contention at each lock, aiding programmers in judging the impact of adopting QD locks. We validate the model using generated benchmarks with multiple locks and showcase the accuracy on an in-memory database application, which is 24% for all 3500 configurations of our benchmark and 14% for critical sections sized no smaller than 1000 nanoseconds.
منابع مشابه
Modeling and Resolving Lock Contention for Multi-threaded Systems
Locks are efficient concurrent control mechanisms to ensure that shared resources are accessed by only a single thread in multi-threaded applications. However, for multi-core systems, lock usage leads to lock contention, which degrades program performance, increases system response time, and negatively affects scalability. This paper initially models lock contention from two aspects: static str...
متن کاملWhat Really Makes Transactions Faster?
There has been a flurry of recent work on the design of high performance software and hybrid hardware/software transactional memories (STMs and HyTMs). This paper reexamines the design decisions behind several of these stateof-the-art algorithms, adopting some ideas, rejecting others, all in an attempt to make STMs faster. The results of our evaluation led us to the design of a transactional lo...
متن کاملCharm: An I/O-Driven High-Performance Transaction Processing System
Performance of transaction processing systems is mostly determined by the amount of required physical disk I/O, which is due to database table accesses or log record writes. This paper describes a high-performance transaction processing system called Charm, which aims to reduce the performance impacts of disk I/O to the minimum. In current transaction processing architectures, a transaction blo...
متن کاملA Simple Correctness Proof of the MCS Contention-Free Lock
Mellor-Crummey and Scott present a spin-lock that avoids network contention by having processors spin on local memory locations. Their algorithm is equivalent to a lock-free queue with a special access pattern. The authors provide a complex and unintuitive proof of the correctness of their algorithm. In this paper, we provide a simple proof that the MCS lock is a correct critical section soluti...
متن کاملMulticore Locks: The Case Is Not Closed Yet
NUMA multicore machines are pervasive and many multithreaded applications are suffering from lock contention. To mitigate this issue, application and library developers can choose from the plethora of optimized mutex lock algorithms that have been designed over the past 25 years. Unfortunately, there is currently no broad study of the behavior of these optimized lock algorithms on realistic app...
متن کامل